﻿@using OA.AspNetCore.Html;
@using OA.Model;
@using OA.Model.View;
@using X.PagedList;
@using OA.Core.Helper;
@using OA.Core.Model;

@model PageList<SimpleKnowledge>
@{
    ViewBag.Title = "知识宝典";
    Layout = "~/Areas/Member/Views/Shared/_Layout.cshtml";
    List<SimpleKnowledgeGroup> listKnowledgeGroup = ViewBag.KnowledgeGroup;
    string keyword = ViewBag.Keyword;
}

<div class="layui-tab layui-tab-brief" lay-filter="user">
    <div class="layui-form layui-tab-content" id="LAY_ucm">
        <form action="" class="layui-form">
            <div class="layui-inline">
                <select name="typeID">
                    <option value="0">全部</option>
                    @foreach (var item in listKnowledgeGroup)
                    {
                        <option value="@item.ID">@item.Name</option>
                    }
                </select>
            </div>
            <div class="layui-inline">
                <input type="text" name="keyWord" class="layui-input" value="" placeholder="标题关键字">
            </div>
            <div class="layui-inline">
                <button type="button" class="layui-btn searchButton">搜索</button>
            </div>
        </form>
    </div>
    <table class="layui-table" lay-data="{url:'GetData', cellMinWidth: 80, page: true,limit:15}" id="resultList" lay-filter="resultList">
        <thead>
            <tr>
                <th lay-data="{field:'ID', width:60}">编号</th>
                <th lay-data="{field:'Title'}">标题</th>
                <th lay-data="{field:'Name', width:120}">类型</th>
                <th lay-data="{field:'Author', width:120}">作者</th>
                <th lay-data="{width:80, align:'center', toolbar: '#barDemo'}">操作</th>
            </tr>
        </thead>
    </table>
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-xs" href="javascript:ShowPage('/Member/Knowledge/Details?id={{d.ID}}','{{d.Title}}')">查看详情</a>
    </script>     
</div> 

